/*
 * @Author: 六弦(melodyWxy)
 * @Date: 2022-03-01 10:22:55
 * @LastEditors: 六弦(melodyWxy)
 * @LastEditTime: 2022-03-01 14:14:04
 * @FilePath: /menorepo-demo/Users/wxy/codeWorks/up/d_form/antd-demo-ts/src/components/XForm/config.ts
 * @Description: update here
 */

import { 
    Form, 
    Input, 
    Checkbox, 
    InputNumber,
    Select
} from 'antd';

import { FormSets, FormItemSets, ChildTypeSets } from './type';


const createFormComponentMap = ()=> {
    const formSet = new Map();
    // 类型与对应组件的映射关系
    formSet.set(FormSets.Form, Form);
    formSet.set(FormItemSets.Item, Form.Item);
    formSet.set(ChildTypeSets.Input, Input);
    formSet.set(ChildTypeSets.Checkbox, Checkbox);
    formSet.set(ChildTypeSets.Password, Input.Password);
    formSet.set(ChildTypeSets.InputNumber, InputNumber);
    formSet.set(ChildTypeSets.Select, Select);
    return formSet;
}

export const formSet = createFormComponentMap();

